package thread;

import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

public class Test01 {
    public static void main(String[] args) throws InterruptedException {
//        TestThread1 thread1 = new TestThread1();
//        thread1.start();

        TestThread2 thread2 = new TestThread2();
        ExecutorService service = Executors.newCachedThreadPool();
        service.execute(new TestThread2());
        service.execute(new TestThread2());
        service.execute(new TestThread2());
        service.execute(new TestThread2());
        for(int i = 0;i < 10;i++){
            Thread.sleep(1000);
            System.out.println("主线程：" + i);
        }

    }
}
